/**
 * Created by dale on 2017/10/17.
 */
var targetObj;
var typeId;
$(document).ready(function () {

    var form = new xhForm($('#xh_form'));


    $(".form-date").datetimepicker({format: 'yyyy-mm-dd', language: 'zh-CN', autoclose: true});


    if(noticeInfo!='1'){
        form.fill(noticeInfo);
    }
    form.parse().bindRequired($('#bt_modal_confirm',parent.document));

    $('#bt_modal_confirm',parent.document).click(function () {
        if(typeId==1){
            $('[name="sNoticeIds"]').val($('#cc').combotree("getValues"));
        }
        $.ajax({
            url:baseUrl+'frontend/msg/saveAffiche',
            data:$('#xh_form').serialize(),
            type:'POST',
            success:function (data) {
                $('#bt_modal_confirm',parent.document).addClass('disabled');
                window.top.xhTop.closeModal();
                window.top.xhTop.getActiveFrame().afficheList.datagrid('reload');

            },
            error:function (data) {
                console.log(data);
            }
        });

    });




});
